package com.ptszyxx.popose.module.base.register;

import android.os.Bundle;
import androidx.lifecycle.ViewModelProviders;
import com.ptszyxx.popose.BR;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.ActivityRegisterBinding;
import com.ptszyxx.popose.module.base.register.vm.RegisterVM;
import com.ysg.base.BaseActivity;
import com.ysg.http.data.AppViewModelFactory;

public class RegisterActivity extends BaseActivity<ActivityRegisterBinding, RegisterVM> {
    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_register;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public RegisterVM initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(RegisterVM.class);
    }

    @Override
    public void initViewObservable() {
        viewModel.uc.onSendCodeEvent.observe(this, o -> binding.tvSendCode.startTimeCountDown());
    }

}
